home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_oth
/
m2cmp20
/
termbase.def
< prev
next >
Wrap
Text File
|
1988-11-19
|
2KB
|
84 lines
DEFINITION MODULE TermBase;
(* (C) Copyright 1987,1988 Fitted Software Tools. All rights reserved. *)
(*
The module Terminal does all of its work thru the procedures
KeyPressed, Read, Write and Goto in this module.
The behaviour of these procedures can be modified by assigning
new procedures to do the work using AssignRead, AssignWrite and
AssignGoto.
*)
TYPE
StatusProcedure = PROCEDURE() :BOOLEAN;
ReadProcedure = PROCEDURE( VAR CHAR );
WriteProcedure = PROCEDURE( CHAR );
GotoProcedure = PROCEDURE( CARDINAL, CARDINAL );
PROCEDURE AssignRead( rp :ReadProcedure; sp :StatusProcedure;
VAR done :BOOLEAN );
(*
save the current Read and KeyPressed procedures in a stack and
install the new procedures to be used in their place
*)
PROCEDURE AssignWrite( wp :WriteProcedure;
VAR done :BOOLEAN );
(*
save the current Write procedure in a stack and install
the new procedure to be used in its place
*)
PROCEDURE AssignGoto( gp :GotoProcedure; VAR done :BOOLEAN );
(*
save the current Goto procedure in a stack and install
the new procedure to be used in its place
*)
PROCEDURE UnAssignRead( VAR done :BOOLEAN );
(*
pop the Read and KeyPressed procedures saved by InstallRead off
the stack and make them active again.
*)
PROCEDURE UnAssignWrite( VAR done :BOOLEAN );
(*
pop the Write procedure saved by InstallWrite off the stack and
make it active again.
*)
PROCEDURE UnAssignGoto( VAR done :BOOLEAN );
(*
pop the Goto procedure saved by InstallGoto off the stack and
make it active again.
*)
PROCEDURE KeyPressed() :BOOLEAN;
(*
invokes the currently installed KeyPressed procedure.
During TermBase initialization, TermIO.KeyPressed is installed.
*)
PROCEDURE Read( VAR ch :CHAR );
(*
invokes the currently installed Read procedure.
During TermBase initialization, TermIO.Read is installed.
*)
PROCEDURE Write( ch :CHAR );
(*
invokes the currently installed Write procedure.
During TermBase initialization, TermIO.Write is installed.
*)
PROCEDURE Goto( line, pos :CARDINAL );
(*
invokes the currently installed Goto procedure.
During TermBase initialization, TermIO.Goto is installed.
*)
END TermBase.